<?php
/**
 * Created by PhpStorm.
 * User: iceberg
 * Date: 2019-01-27
 * Time: 13:38
 */

namespace app\validate;

use think\Validate;
class DataValidate extends Validate
{
    protected $rule = [
        'pname'         =>  'require',
        'type1'         =>  'require',
        'unit'          =>  'require',
        'contact'       =>  'require',
        'phone'         =>  'require',
        'email'         =>  'require|email',
        'address'       =>  'require',
        'yzm'           =>  'require|captcha',
    ];

    protected $message  =   [
        'pname.require' =>  '项目名称必填！',
        'type1.require' =>  '申报类型必填！',
        'unit.require'  =>  '申报单位必填！',
        'contact.require'   =>  '联系人必填！',
        'phone.require'     =>  '联系电话必填！',
        'email.require'     =>  '电子邮箱必填！',
        'email.email'       =>  '电子邮箱格式错误!',
        'address.require'   =>  '通信地址必填！',
        'yzm.require'       =>  '验证码必埴！',
        'yzm.captcha'       =>  '验证码有误！',
    ];
}